﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DanhSachSanPham : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string ma_loai = Request.QueryString["ma_loai"];
        // SqlDataSource1.SelectCommand = "SELECT [TenTL], [TacGia], [MoTa], [HinhAnh], [DonGia], FROM [TaiLieu] WHERE IDLoaiTL=" + ma_loai;
        SqlDataSource1.SelectCommand = "SELECT *,(SELECT B2.TenLoaiTL FROM LoaiTaiLieu B2 WHERE B1.IDLoaiTL = B2.IDLoaiTL) TenLoaiTL FROM [TaiLieu] B1 WHERE IDLoaiTL=" + ma_loai + " ORDER by B1.ThuTuHienThi";
        ListView1.DataSource = SqlDataSource1;
        ListView1.DataBind();
    }
}